package com.example.service;

import com.alibaba.csp.sentinel.Entry;
import com.alibaba.csp.sentinel.SphU;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.stereotype.Component;

/**
 * @ClassName IndexServiceImpl
 * @Description TODO
 * @Author: XMK
 * @Date: 2020/5/9 15:09
 * @Version: 1.0
 */
@Component
public class IndexServiceImpl implements IndexService {
    @Override
    public void buz() {
        try (Entry entry = SphU.entry("buz")) {

            System.out.println("buzbuzbuzbuzbuzbuz");
        } catch (BlockException e) {
            System.out.println("buz sentinel blocked");
        }
    }
}
